/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package batailledesardennes.game.map.tilemap;

import batailledesardennes.util.straightedge.KMultiPolygon;
import batailledesardennes.util.straightedge.KPoint;
import batailledesardennes.util.straightedge.KPolygon;

/**
 *
 * @author charly
 */
public class TileUtils {
   // tile id
   public final static short TILE_ID_GRASS = 0;

   public static KMultiPolygon getPolygon(int tileId) {
      switch (tileId) {
         case 8:
         case 11:
         case 14: {
            KPoint pt1 = new KPoint(0, 6);
            KPoint pt2 = new KPoint(20, 6);
            KPoint pt3 = new KPoint(20, 13);
            KPoint pt4 = new KPoint(0, 13);
            return new KMultiPolygon(new KPolygon(pt1, pt2, pt3, pt4));
         }
         case 7:
         case 10:
         case 13: {
            KPoint pt1 = new KPoint(9, 20);
            KPoint pt2 = new KPoint(20, 6);
            KPoint pt3 = new KPoint(20, 13);
            KPoint pt4 = new KPoint(13, 20);
            return new KMultiPolygon(new KPolygon(pt1, pt2, pt3, pt4));
         }
         case 9:
         case 12:
         case 15: {
            KPoint pt1 = new KPoint(0, 6);
            KPoint pt2 = new KPoint(13, 20);
            KPoint pt3 = new KPoint(9, 20);
            KPoint pt4 = new KPoint(0, 13);
            return new KMultiPolygon(new KPolygon(pt1, pt2, pt3, pt4));
         }
         case 26:
         case 29:
         case 32:
         case 28:
         case 31:
         case 34: {
            KPoint pt1 = new KPoint(9, 0);
            KPoint pt2 = new KPoint(13, 0);
            KPoint pt3 = new KPoint(13, 20);
            KPoint pt4 = new KPoint(9, 20);
            return new KMultiPolygon(new KPolygon(pt1, pt2, pt3, pt4));
         }
         case 45:
         case 48:
         case 51: {
            KPoint pt1 = new KPoint(9, 0);
            KPoint pt2 = new KPoint(13, 0);
            KPoint pt3 = new KPoint(20, 6);
            KPoint pt4 = new KPoint(20, 11);
            return new KMultiPolygon(new KPolygon(pt1, pt2, pt3, pt4));
         }
         case 46:
         case 49:
         case 52: {
            KPoint pt1 = new KPoint(0, 6);
            KPoint pt2 = new KPoint(20, 6);
            KPoint pt3 = new KPoint(20, 11);
            KPoint pt4 = new KPoint(0, 11);
            return new KMultiPolygon(new KPolygon(pt1, pt2, pt3, pt4));
         }
         case 47:
         case 50:
         case 53: {
            KPoint pt1 = new KPoint(0, 6);
            KPoint pt2 = new KPoint(9, 0);
            KPoint pt3 = new KPoint(13, 0);
            KPoint pt4 = new KPoint(0, 11);
            return new KMultiPolygon(new KPolygon(pt1, pt2, pt3, pt4));
         }
         case 64:
         case 67:
         case 69:
         case 74: {
            KPoint pt1 = new KPoint(9, 0);
            KPoint pt2 = new KPoint(13, 0);
            KPoint pt3 = new KPoint(0, 13);
            KPoint pt4 = new KPoint(0, 6);
            return new KMultiPolygon(new KPolygon(pt1, pt2, pt3, pt4));
         }
         case 65:
         case 68:
         case 70:
         case 71: {
            KPoint pt1 = new KPoint(9, 0);
            KPoint pt2 = new KPoint(13, 0);
            KPoint pt3 = new KPoint(20, 6);
            KPoint pt4 = new KPoint(20, 13);
            return new KMultiPolygon(new KPolygon(pt1, pt2, pt3, pt4));
         }
         case 83:
         case 86:
         case 88:
         case 93: {
            KPoint pt1 = new KPoint(0, 6);
            KPoint pt2 = new KPoint(0, 11);
            KPoint pt3 = new KPoint(9, 20);
            KPoint pt4 = new KPoint(13, 20);
            return new KMultiPolygon(new KPolygon(pt1, pt2, pt3, pt4));
         }
         case 84:
         case 87:
         case 89:
         case 90: {
            KPoint pt1 = new KPoint(20, 6);
            KPoint pt2 = new KPoint(20, 11);
            KPoint pt3 = new KPoint(13, 20);
            KPoint pt4 = new KPoint(9, 20);
            return new KMultiPolygon(new KPolygon(pt1, pt2, pt3, pt4));
         }
      }
      return null;
   }
}
